package org.example.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MsgController {
    @Autowired
    JmsTemplate jmsTemplate;


    @PostMapping("send")
    public   void send(String msg){
        jmsTemplate.convertAndSend("test_msg",msg);
        System.out.printf("你发送了"+msg);
    }
}
